package com.atguigu.test;

import com.atguigu.bean.Person;
import com.atguigu.config.MainConfig4;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertySource;

public class IOCTestPropValue {
    AnnotationConfigApplicationContext applicationContext =
            new AnnotationConfigApplicationContext(MainConfig4.class);

    @Test
    public void test01() {
        Person person = (Person) applicationContext.getBean("person");
        System.out.println(person.getName());

        String property = applicationContext.getEnvironment().getProperty("person.nickName");
        System.out.println(property);

    }
}
